﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Td.Additional.ComponentModel
{
    /// <summary>
    /// Multiline text attribute class.
    /// </summary>
    [AttributeUsage(AttributeTargets.Property, Inherited = false, AllowMultiple = false)]
    public sealed class MultilineTextAttribute : Attribute
    {
        #region Public static fields

        /// <summary>
        /// Default visible line count.
        /// </summary>
        public static int DefaultVisibleLines = 5;

        #endregion

        #region Properties

        /// <summary>
        /// Gets or sets the visible lines.
        /// </summary>
        /// <value>The visible lines.</value>
        public int VisibleLines { get; private set; }

        #endregion

        #region Constructors

        /// <summary>
        /// Initializes a new instance of the <see cref="MultilineTextAttribute"/> class.
        /// </summary>
        public MultilineTextAttribute()
            : base()
        {
            VisibleLines = DefaultVisibleLines;
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="MultilineTextAttribute"/> class.
        /// </summary>
        /// <param name="visibleLines">The visible lines.</param>
        public MultilineTextAttribute(int visibleLines)
            : this()
        {
            VisibleLines = visibleLines;
        }

        #endregion
    }
}